package com.bank.controller;

import com.alibaba.fastjson.JSON;
import com.bank.service.VerifyService;
import com.fasterxml.jackson.databind.util.JSONPObject;
import org.apache.tomcat.util.json.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 王迎澳
 * @version 1.0
 * @school hhu
 * @date 2022/6/22 14:05
 */
@RestController
public class LoginController {

    @Autowired
    VerifyService verifyService;

    @RequestMapping(value = "/verifyLogin",method = RequestMethod.POST)
    public String verify(@RequestBody Map<String, String> map) {
        String account = map.get("userID");
        String password = map.get("password");
        return JSON.toJSONString(verifyService.verifyLogin(account,password));
    }




}
